#coding:utf-8
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium import webdriver
import time
from untils.ElementReader import YamlReader
from selenium.webdriver.common.keys import Keys
from untils.CSVREADER import EXCEL

from Pages.BasePage import BasePage
import time

class PLS_Home(BasePage):
    def __init__(self):
        super().__init__(self)
        self.url = self.yamlreader.get_url("PLS_Home","url")
        self.search = self.yamlreader.get_element("PLS_Home","search")
        self.input = self.yamlreader.get_element("PLS_Home","input")
        # self.search = EXCEL("casesdata.xlsx").get_data_by_case_no('元素定位','Home')

    def test_search(self,content):
        #搜索按钮
        # print(self.search)
        self.get(self.url)
        self.find_element(self.search).click()
        self.find_element(self.input).send_keys(content,Keys.ENTER)
        time.sleep(3)

if __name__ == '__main__':
    print(PLS_Home().test_search("普洛斯"))